<template>
    <div>
        <a-modal
            :visible="visible"
            title="选择审批单"
            :maskClosable="false"
            :closable="true"
            :destroyOnClose="true"
            width="60%"
            :dialog-style="{ margin: '0 auto'}"
            wrapClassName=""
            @ok="handleOk"
            @cancel="visible = false"
            >
            <commpVxeTable
                :key="reCommpVxeTable"
                :config="dataTableConfig"
                :columns="columnsVxe"
                :formItem="formItem"
                @radioChange="checkboxChange"
                ref="administrativeOffice"
                @searchEvent="searchEvent"
                @resetEvent="resetEvent"
                >
            </commpVxeTable>
        </a-modal>
    </div>
</template>
<script>
import commpVxeTable from '@/components/commp-vxe-table/commp-vxe-table.vue'
import YchConstant from "@/api/YchConstant";
import assessCheckApi from './service/api.js'
import {lcEndList} from './service/index'
export default {
    components: {
        commpVxeTable
    },
    props:{
    },
    data() {
      return {
        visible: false,
        reCommpVxeTable: '',
        dataTableConfig: {
            api: assessCheckApi.lcEndList,
            rowId: 'id',
            urlType: true,
            paramet:{}
        },
        formItem: [
          {
            label: '日期',
            model: 'endTime',
            type: 'datePicker',
            format: 'YYYY-MM-DD'
          },{
            label: '事项',
            model: 'fsx',
          },
        ],
        columnsVxe: [
          {
            type: 'radio',
            width: 60,
            fixed: 'left'
          },{
            title: '事项',
            field: 'fsx',
          },{
            title: '拟办意见',
            field: 'fnbyj',
          },{
            title: '日期',
            field: 'frq',
          },{
            title: '拟办意见',
            field: 'fnbyj',
          },
        ],
        valData: {}
      }
    },
    methods: {
        // 勾选
        checkboxChange(val){
            //console.log(val.newValue)
            this.valData = val.newValue
        },
        // 搜索
        searchEvent(){
            this.dataTableConfig.paramet = {
                ...this.dataTableConfig.paramet,
            }
            //console.log(this.dataTableConfig.paramet)
        },
        // 重置
        resetEvent(){
            this.dataTableConfig.paramet = {
                ...this.dataTableConfig.paramet,
            }
        },
        handleOk(e){
            // //console.log(e)
            this.visible = false
            this.$emit('getApplyfor',this.valData?this.valData:'')
        },
    },
  }
  </script>
  <style lang="less">
  .red-btn{
      color:  white !important;
      border: 1px solid #ed5565 !important;
      background-color: #ed5565 !important;
  }
  </style>
